// core2 v1.1.0 - http://code.google.com/p/core2/ (MPL 1.1)

var self=this;if(!self.buRRRn)
{self.buRRRn={};}
if(!buRRRn.core2)
{buRRRn.core2={};}
buRRRn.core2.version="1.1.0."+parseInt("$Rev: 131 $".split(" ")[1]);;buRRRn.core2.config={};buRRRn.core2.config.CRLF="\n";buRRRn.core2.config.backwardCompatible=false;buRRRn.core2.config.showInfo=false;buRRRn.core2.config.fixGetYear=false;buRRRn.core2.config.errorCtor=false;buRRRn.core2.config.allowToSource=false;buRRRn.core2.config.opAsTopLevel=false;buRRRn.core2.config.globalsReserved=["_global"];buRRRn.core2.config.host="";buRRRn.core2.config.hostMoreInfo="";buRRRn.core2.config.language="";buRRRn.core2.config.languageMoreInfo="";buRRRn.core2.strings={};buRRRn.core2.strings.hostNotFound="Host not found";buRRRn.core2.strings.message="";buRRRn.core2.getString=function(name)
{if(!this.strings[name])
{return"";}
return this.strings[name];}
buRRRn.core2.isGlobalReserved=function(name)
{var words=this.config.globalsReserved.join("|");if(words.indexOf(name)>-1)
{return true;}
return false;}
buRRRn.core2.addReserved=function(name)
{var words=this.config.globalsReserved.join("|");var contains=function(word)
{return words.indexOf(word)>-1;}
if(!contains(name))
{this.config.globalsReserved.push(name);}}
buRRRn.core2.introspectEnvironment=function()
{var env={host:"",lang:""};if((this.config.host!="")&&(this.config.language!=""))
{env.host=this.config.host;env.lang=this.config.language;return env;}
if((typeof WSH!="undefined")||(typeof WScript!="undefined"))
{env.host="WSH";env.lang="JScript";this.config.hostMoreInfo=WScript.Version;this.config.languageMoreInfo=ScriptEngineMajorVersion()+"."+ScriptEngineMinorVersion()+"."+ScriptEngineBuildVersion();}
if((typeof Server!="undefined")||(typeof Stream!="undefined")||(typeof ActiveX!="undefined"))
{env.host="JSDB";env.lang="JavaScript";this.config.hostMoreInfo="build "+system.buildDate;this.config.languageMoreInfo=system.version/100;}
if((typeof $version!="undefined")||(typeof MovieClip!="undefined"))
{env.host="Flash";env.lang="ActionScript";this.config.hostMoreInfo=$version;}
if((typeof document!="undefined")||(typeof window!="undefined")||(typeof navigator!="undefined")||(typeof location!="undefined"))
{env.host="Browser";env.lang="JavaScript";if(navigator.userAgent.indexOf("MSIE")!=-1)
{this.config.hostMoreInfo="MSIE";env.lang="JScript";this.config.languageMoreInfo=ScriptEngineMajorVersion()+"."+ScriptEngineMinorVersion()+"."+ScriptEngineBuildVersion();}
else if(navigator.userAgent.indexOf("Firefox")!=-1)
{this.config.hostMoreInfo="Firefox";}
else if(navigator.userAgent.indexOf("Opera")!=-1)
{this.config.hostMoreInfo="Opera";}
else if(navigator.userAgent.indexOf("AppleWebKit")!=-1)
{this.config.hostMoreInfo="Safari";}
if(location.href.split(".").pop()=="hta")
{this.config.hostMoreInfo="MSIE HTA";}}
if((env.host=="")||(env.lang==""))
{env.host="Unknown";env.lang="ECMAScript";trace("## WARNING : "+this.strings.hostNotFound+" ##");}
this.config.host=env.host;this.config.language=env.lang;return env;}
buRRRn.core2.getHost=function()
{if(this.config.host!="")
{return this.config.host;}
var env=this.introspectEnvironment();return env.host;}
buRRRn.core2.getLanguage=function()
{if(this.config.language!="")
{return this.config.language;}
var env=this.introspectEnvironment();return env.lang;}
buRRRn.core2.hasFunctionSource=function()
{var test=function()
{return"true";}
return test.toString().indexOf("return \"true\";")>0;}
buRRRn.core2.introspectGlobal=function()
{switch(this.getHost())
{case"JSDB":break;case"WSH":this.addReserved("WSH");this.addReserved("WScript");break;case"Browser":this.addReserved("document");this.addReserved("window");this.addReserved("navigator");this.addReserved("location");for(var o in self)
{if((o=="buRRRn")||(o=="core2")||(o=="_global"))
{continue;}
this.addReserved(o);}
break;}}
buRRRn.core2.infos=function()
{var hostmi="";var langmi="";if(this.config.hostMoreInfo!="")
{hostmi=" ( "+this.config.hostMoreInfo+" )";}
if(this.config.languageMoreInfo!="")
{langmi=" v"+this.config.languageMoreInfo;}
trace("core2 v"+this.version);trace("-- Environment --");trace("hasFunctionSource:  "+this.hasFunctionSource());trace("host:               "+this.getHost()+hostmi);trace("language:           "+this.getLanguage()+langmi);trace("-- Configuration options --");trace("backwardCompatible: "+this.config.backwardCompatible);trace("showInfo:           "+this.config.showInfo);trace("fixGetYear:         "+this.config.fixGetYear);trace("errorCtor:          "+this.config.errorCtor);trace("allowToSource:      "+this.config.allowToSource);trace("opAsTopLevel:       "+this.config.opAsTopLevel);trace("globalsReserved:   ["+this.config.globalsReserved+"]");}
buRRRn.core2.setTrace=function(traceFunction)
{_global.trace=function(o)
{traceFunction(o);}
if(this.strings.message!="")
{trace(this.strings.message);this.strings.message="";}}
buRRRn.core2.main=function()
{this.introspectEnvironment();this.introspectGlobal();switch(this.getHost())
{case"WSH":self._global=self;delete self;this.config.errorCtor=false;this.config.CRLF="\n";_global.trace=function(o)
{WScript.Echo(String(o));}
break;case"JSDB":self._global=self;delete self;this.config.errorCtor=false;this.config.CRLF="\n";_global.trace=function(o)
{writeln(String(o));}
break;case"Flash":_global.buRRRn=self.buRRRn;delete self;this.config.errorCtor=true;this.config.CRLF="\n";Object.prototype.propertyIsEnumerable=Object.prototype.isPropertyEnumerable;break;case"Browser":self._global=self;delete self;this.config.errorCtor=false;this.config.CRLF="\r\n";if(this.config.hostMoreInfo=="Firefox")
{this.config.CRLF="\n";}
_global.trace=function(o)
{buRRRn.core2.strings.message+=String(o+buRRRn.core2.config.CRLF);}
break;case"Unknown":default:}}
buRRRn.core2._changeCompatibility=function()
{if(this.config.backwardCompatible)
{_global.GetTypeOf=buRRRn.Reflection.getTypeOf;_global.GetObjectPath=function(o)
{return buRRRn.Reflection.getObjectPath(o);}}
else
{if(_global.GetTypeOf)
{delete _global.GetTypeOf;}
if(_global.GetObjectPath)
{delete _global.GetObjectPath;}}}
buRRRn.core2._changeToSource=function()
{if(this.config.backwardCompatible&&this.config.allowToSource)
{Boolean.prototype.toSource=function()
{return(this==true)?"true":"false";}
Number.prototype.toSource=function()
{return this.toString();}
Function.prototype.toSource=function()
{return"(function)";}
String.prototype.toSource=function()
{return buRRRn.eden.Serializer.emitString(this);}
Object.prototype.toSource=function()
{return buRRRn.eden.Serializer.emitObject(this);}
Array.prototype.toSource=function()
{return buRRRn.eden.Serializer.emitArray(this);}
Date.prototype.toSource=function()
{return buRRRn.eden.Serializer.emitDate(this);}
Error.prototype.toSource=function()
{return"new Error(\""+this.message+"\")";}
_global.ToSource=function()
{return buRRRn.eden.Serializer.emitGlobal(_global);}}
else
{if(Boolean.prototype.toSource)
{delete Boolean.prototype.toSource;}
if(Number.prototype.toSource)
{delete Number.prototype.toSource;}
if(Function.prototype.toSource)
{delete Function.prototype.toSource;}
if(String.prototype.toSource)
{delete String.prototype.toSource;}
if(Object.prototype.toSource)
{delete Object.prototype.toSource;}
if(Array.prototype.toSource)
{delete Array.prototype.toSource;}
if(Date.prototype.toSource)
{delete Date.prototype.toSource;}
if(Error.prototype.toSource)
{delete Error.prototype.toSource;}
if(_global.ToSource)
{delete _global.ToSource;}}}
buRRRn.core2._changeOperators=function()
{if(this.config.opAsTopLevel)
{_global.is=function(o)
{return buRRRn.core2.operators.is(o);}}
else
{if(_global.is)
{delete _global.is;}}}
buRRRn.core2.after=function()
{this._changeOperators();this._changeCompatibility();this._changeToSource();if(this.config.showInfo)
{this.infos();}}
buRRRn.core2.changeConfig=function(options)
{if(options.backwardCompatible&&(options.backwardCompatible!=this.config.backwardCompatible))
{this.config.backwardCompatible=options.backwardCompatible;this._changeCompatibility();if(options.allowToSource&&(options.allowToSource!=this.config.allowToSource))
{this.config.allowToSource=options.allowToSource;this._changeToSource();}}}
buRRRn.core2.main();Array.prototype.clone=function()
{return this.concat();}
Array.prototype.contains=function(value)
{return(this.indexOf(value)>-1);}
Array.prototype.copy=function()
{var arr,i;arr=[];for(i=0;i<this.length;i++)
{if(this[i]===undefined)
{arr[i]=undefined;continue;}
if(this[i]===null)
{arr[i]=null;continue;}
arr[i]=this[i].copy();}
return arr;}
Array.prototype.copyTo=function(destination,index)
{var i;if(destination==null)
{return;}
if(index==null)
{index=0;}
for(i=0;i<this.length;i++,index++)
{if(this[i]===undefined)
{destination[index]=undefined;continue;}
if(this[i]===null)
{destination[index]=null;continue;}
destination[index]=this[i].copy();}}
Array.prototype.equals=function(arrObj)
{var i;if((arrObj==null)||(buRRRn.Reflection.getTypeOf(arrObj)!="array"))
{return false;}
if(this==arrObj)
{return true;}
if(this.length!=arrObj.length)
{return false;}
for(i=0;i<this.length;i++)
{if(this[i]==null)
{if(this[i]!=arrObj[i])
{return false;}
continue;}
if(!this[i].equals(arrObj[i]))
{return false;}}
return true;}
if(!Array.prototype.every)
{Array.prototype.every=function(callback,thisObject)
{var len,i;len=this.length;if(thisObject==null)
{thisObject=_global;}
for(i=0;i<len;i++)
{if(!callback.call(thisObject,this[i],i,this))
{return false;}}
return true;}}
if(!Array.prototype.filter)
{Array.prototype.filter=function(callback,thisObject)
{var arr,i;arr=[];if(thisObject==null)
{thisObject=_global;}
for(i=0;i<this.length;i++)
{if(callback.call(thisObject,this[i],i,this))
{if(this[i]===undefined)
{arr.push(undefined);continue;}
if(this[i]===null)
{arr.push(null);continue;}
arr.push(this[i].copy());}}
return arr;}}
if(!Array.prototype.forEach)
{Array.prototype.forEach=function(callback,thisObject)
{var len,i;len=this.length;if(thisObject==null)
{thisObject=_global;}
for(i=0;i<len;i++)
{callback.call(thisObject,this[i],i,this);}}}
Array.fromArguments=function(args)
{var arr,i;arr=[];for(i=0;i<args.length;i++)
{arr.push(args[i]);}
return arr;}
Array.prototype.indexOf=function(value,startIndex,count)
{var i;if(startIndex==null)
{startIndex=0;}
if(count==null)
{count=this.length-startIndex;}
if((startIndex<0)||(startIndex>this.length))
{return;}
if((count<0)||(count>(this.length-startIndex)))
{return;}
if(value==null)
{value=new NullObject();}
for(i=0;startIndex<this.length;startIndex++,i++)
{if(value.equals(this[startIndex]))
{return startIndex;}
if(i==count)
{break;}}
return-1;}
Array.initialize=function(index,value)
{if(index==null)
{index=0;}
if(value===undefined)
{value=null;}
var arr,i;arr=[];for(i=0;i<index;i++)
{arr.push(value);}
return arr;}
if(!Array.prototype.map)
{Array.prototype.map=function(callback,thisObject)
{var arr,i;arr=[];if(thisObject==null)
{thisObject=_global;}
for(i=0;i<this.length;i++)
{arr.push(callback.call(thisObject,this[i],i,this));}
return arr;}}
if(!Array.prototype.some)
{Array.prototype.some=function(callback,thisObject)
{var len,i;len=this.length;if(thisObject==null)
{thisObject=_global;}
for(i=0;i<len;i++)
{if(callback.call(thisObject,this[i],i,this))
{return true;}}
return false;}}
Boolean.prototype.compareTo=function(obj)
{if(obj==null)
{return 1;}
if(buRRRn.Reflection.getTypeOf(obj)!="boolean")
{return;}
if(this.equals(obj))
{return 0;}
else if(this.equals(false))
{return-1;}
return 1;}
Boolean.prototype.clone=function()
{return this;}
Boolean.prototype.copy=function()
{return this.valueOf();}
Boolean.prototype.equals=function(boolObj)
{if((boolObj==null)||(buRRRn.Reflection.getTypeOf(boolObj)!="boolean"))
{return false;}
return(this.valueOf()==boolObj.valueOf());}
Date.prototype.clone=function()
{return this;}
Date.prototype.copy=function()
{return new Date(this.valueOf());}
Date.prototype.equals=function(datObj)
{if((datObj==null)||(buRRRn.Reflection.getTypeOf(datObj)!="date"))
{return false;}
return(this.toString()==datObj.toString());}
if(buRRRn.core2.config.fixGetYear)
{Date.prototype.getYear=Date.prototype.getFullYear;}
if(buRRRn.core2.config.errorCtor)
{_global.Error=function(message)
{if(message==null)
{message="";}
this.name="Error";this.message=String(message);}}
Error.prototype.message="";Error.prototype.equals=function(errObj)
{if((errObj==null)||(buRRRn.Reflection.getTypeOf(errObj)!="error"))
{return false;}
return(this.toString()==errObj.toString());}
Error.prototype.getMessage=function()
{if(this.message==undefined)
{return"";}
return this.message;}
Error.prototype.toString=function()
{var separator,message;separator=" : ";message=this.getMessage();if(message!="")
{message=separator+message;}
return"## "+this.name+message+" ##";}
Function.prototype.clone=function()
{return this;}
Function.prototype.copy=function()
{return this.valueOf();}
Function.prototype.equals=function(fctObj)
{if((fctObj==null)||(buRRRn.Reflection.getTypeOf(fctObj)!="function"))
{return false;}
if(this.valueOf()==fctObj.valueOf())
{return true;}
if(buRRRn.core2.hasFunctionSource())
{if(this.toString()==fctObj.toString())
{return true;}}
return false;}
_global.NullObject=function()
{}
NullObject.prototype.toString=function()
{return"null";}
NullObject.prototype.valueOf=function()
{return null;}
Number.prototype.clone=function()
{return this;}
Number.prototype.copy=function()
{return this.valueOf();}
Number.prototype.equals=function(numObj)
{if((numObj==null)||(buRRRn.Reflection.getTypeOf(numObj)!="number"))
{return false;}
if(this.valueOf()==numObj.valueOf())
{return true;}
return false;}
if(!Number.prototype.toExponential)
{Number.prototype.toExponential=function(fractionDigits)
{var x,s,str,l,lm,n;x=this;s="+";if(isNaN(x))
{return"NaN";}
if(x<0)
{s="-";x=-x;}
if(x==Infinity)
{return s+"Infinity";}
l=Math.floor(Math.log(x)/Math.LN10);lm=Math.pow(10,l);n=x/lm;if(fractionDigits==null)
{str=n.toString();}
else
{if(fractionDigits<0)
{fractionDigits=0;}
else if(fractionDigits>20)
{fractionDigits=20;}
str=n.toFixed(fractionDigits);}
str+="e"+s+l;return str;}}
if(!Number.prototype.toFixed)
{Number.prototype.toFixed=function(fractionDigits)
{var x,m,r,str,d,i;x=this;if(isNaN(x))
{return"NaN";}
if((fractionDigits==null)||(fractionDigits<0))
{fractionDigits=0;}
else if(fractionDigits>20)
{fractionDigits=20;}
m=Math.pow(10,fractionDigits);r=Math.round(x*m)/m;str=r.toString();d=str.split(".")[1];if(d&&(d.length<fractionDigits))
{for(i=0;i<(fractionDigits-d.length);i++)
{str+="0";}}
return str;}}
if(!Number.prototype.toPrecision)
{Number.prototype.toPrecision=function(precision)
{var x,l,m,r,str,d,i;x=this;str=x.toString();if(isNaN(x))
{return"NaN";}
if((precision==null)||(x==Infinity)||(x==-Infinity))
{return this.toString();}
if(precision<1)
{precision=1;}
else if(precision>21)
{precision=21;}
if(str.length>precision)
{return x.toExponential(precision-1);}
l=Math.floor(Math.log(x)/Math.LN10);m=Math.pow(10,l+1-precision);r=Math.round(x/m)*m;str=r.toString();d=str.split(".").join("");if(d&&(d.length<precision))
{if(str.indexOf(".")==-1)
{str+=".";}
for(i=0;i<(precision-d.length);i++)
{str+="0";}}
return str;}}
Object.prototype.clone=function()
{return this;}
Object.prototype.copy=function()
{var obj,member;obj={};for(member in this)
{if(!this.hasOwnProperty(member))
{continue;}
if(this[member]===undefined)
{obj[member]=undefined;continue;}
if(this[member]===null)
{obj[member]=null;continue;}
obj[member]=this[member].copy();}
return obj;}
Object.prototype.equals=function(obj)
{var member;if(buRRRn.Reflection.getTypeOf(obj)=="function")
{return obj.equals(this);}
if((this.valueOf()==null)&&(obj==null))
{return true;}
if((obj==null)||(buRRRn.Reflection.getTypeOf(obj)!="object"))
{return false;}
if(this==obj)
{return true;}
for(member in this)
{if(member.startsWith("__"))
{continue;}
if(!this[member].equals(obj[member]))
{return false;}}
return true;}
Object.prototype.hasProperty=function(name)
{return(this[name]!=undefined);}
if(!Object.prototype.isPrototypeOf)
{Object.prototype.isPrototypeOf=function(value)
{var self=this.constructor;if(typeof value!="object")
{return false;}
if(value instanceof self)
{return true;}
else
{return false;}}}
Object.prototype.memberwiseClone=function()
{var obj,member;obj={};for(member in this)
{obj[member]=this[member];}
return obj;}
Object.prototype.memberwiseCopy=Object.prototype.copy;if(!Object.prototype.propertyIsEnumerable)
{Object.prototype.propertyIsEnumerable=function(name)
{for(var member in this)
{if(this.hasOwnProperty(name)&&(member==name))
{return true;}}
return false;}}
Object.prototype.referenceEquals=function(obj)
{if((this.valueOf()===null)&&(obj===null))
{return true;}
if(this===obj)
{return true;}
if((obj==null)||(buRRRn.Reflection.getTypeOf(obj)!="object"))
{return false;}
if(this!==obj)
{return false;}
return true;}
String.prototype.clone=function()
{return this;}
String.compare=function(strA,strB,ignoreCase)
{if((strA==null)||(strB==null))
{if(strA==strB)
{return 0;}
else if(strA==null)
{return-1;}
else
{return 1;}}
if((buRRRn.Reflection.getTypeOf(strA)!="string")||(buRRRn.Reflection.getTypeOf(strB)!="string"))
{return;}
strA=strA.toString();strB=strB.toString();if(ignoreCase==true)
{strA=strA.toLowerCase();strB=strB.toLowerCase();}
if(strA==strB)
{return 0;}
else if(strA.length>strB.length)
{return 1;}
else
{return-1;}}
String.prototype.compareTo=function(value)
{if(value==null)
{return 1;}
if(buRRRn.Reflection.getTypeOf(value)!="string")
{return;}
return String.compare(this.valueOf(),value.valueOf());}
String.prototype.copy=function()
{return this.valueOf();}
String.prototype.equals=function(strObj)
{if((strObj==null)||(buRRRn.Reflection.getTypeOf(strObj)!="string"))
{return false;}
if(this.toString()==strObj.toString())
{return true;}
return false;}
String.empty="";String.prototype.endsWith=function(value)
{if(value==null)
{return false;}
if(this.length<value.length)
{return false;}
return String.compare(this.substr(this.length-value.length),value)==0;}
String.format=function(format,argN)
{if((arguments.length==0)||(format=="")||((format.indexOf("{")==-1)&&(format.indexOf("}")==-1)))
{return format;}
var paddingChar=" ";var indexedValues=[];var namedValues={};var args=Array.fromArguments(arguments);args.shift();if(args.length>=1)
{if(args[0]instanceof Array)
{indexedValues=indexedValues.concat(args[0]);args.shift();}
else if((args[0]instanceof Object)&&(String(args[0])=="[object Object]"))
{for(var prop in args[0])
{namedValues[prop]=args[0][prop];}
args.shift();}}
indexedValues=indexedValues.concat(args);var ORC1="\uFFFC";var ORC2="\uFFFD";if(format.indexOfAny(["{{","}}"])>-1)
{format=format.split("{{{").join(ORC1+"{");format=format.split("{{").join(ORC1);format=format.split("}}}").join("}"+ORC2);format=format.split("}}").join(ORC2);}
var parseExpression=function(expression)
{var value="";var spaceAlign=0;var isAligned=false;var padding=paddingChar;if(expression.indexOfAny([",",":"])>-1)
{var vPos=expression.indexOf(",");if(vPos==-1)
{trace("malformed format, could not find [,] before [:].");return"";}
var fPos=expression.indexOf(":");if(fPos==-1)
{spaceAlign=parseInt(expression.substr(vPos+1));}
else
{spaceAlign=parseInt(expression.substring(vPos+1,fPos));padding=expression.substr(fPos+1);}
isAligned=true;expression=expression.substring(0,vPos);}
var c=expression.split("")[0];if((("A"<=c)&&(c<="Z"))||(("a"<=c)&&(c<="z")))
{value=String(namedValues[expression]);}
else if(("0"<=c)&&(c<="9"))
{value=String(indexedValues[parseInt(expression)]);}
if(isAligned)
{if((spaceAlign>0)&&(value.length<spaceAlign))
{value=value.padLeft(spaceAlign,padding);}
else(-value.length<spaceAlign)
{value=value.padRight(-spaceAlign,padding);}}
return value;}
var expression="";var formated="";var ch="";var pos=0;var len=format.length;var next=function()
{ch=format.charAt(pos);pos++;return ch;}
while(pos<len)
{next();if(ch=="{")
{expression=next();while(next()!="}")
{expression+=ch;}
formated+=parseExpression(expression);}
else
{formated+=ch;}}
if(formated.indexOfAny([ORC1,ORC2])>-1)
{formated=formated.split(ORC1).join("{");formated=formated.split(ORC2).join("}");}
return formated;}
String.prototype.indexOfAny=function(anyOf,startIndex,count)
{var i,endIndex;if(anyOf==null)
{return;}
if(this.length==0)
{return-1;}
if((startIndex==null)||(startIndex<0))
{startIndex=0;}
if((count==null)||(count<0)||(count>anyOf.length-startIndex))
{endIndex=anyOf.length-1;}
else
{endIndex=startIndex+count-1;}
for(i=startIndex;i<=endIndex;i++)
{if(this.indexOf(anyOf[i])>-1)
{return i;}}
return-1;}
String.prototype.insert=function(startIndex,value)
{var str,strA,strB;str=this.copy();if(value==null)
{return str;}
if(str=="")
{return value;}
if(startIndex==0)
{return value+str;}
else if((startIndex==null)||(startIndex==str.length))
{return str+value;}
strA=str.substr(0,startIndex);strb=str.substr(startIndex);return strA+value+strB;}
String.prototype.lastIndexOfAny=function(anyOf,startIndex,count)
{var i,endIndex;if(anyOf==null)
{return;}
if(this.length==0)
{return-1;}
if((startIndex==null)||(startIndex<0)||(startIndex>anyOf.length))
{startIndex=anyOf.length-1;}
if((count==null)||(count<0)||(count>startIndex+1))
{endIndex=0;}
else
{endIndex=startIndex-count+1;}
for(i=startIndex;i>=endIndex;i--)
{if(this.lastIndexOf(anyOf[i])>-1)
{return i;}}
return-1;}
String.prototype._padHelper=function(totalWidth,paddingChar,isRightPadded)
{var str,SPC;str=this.copy();SPC=" ";if((totalWidth<str.length)||(totalWidth<0))
{return str;}
if(paddingChar==null)
{paddingChar=SPC;}
if(paddingChar.length>1)
{paddingChar=paddingChar.charAt(0);}
while(str.length!=totalWidth)
{if(isRightPadded==true)
{str+=paddingChar;}
else
{str=paddingChar+str;}}
return str;}
String.prototype.padLeft=function(totalWidth,paddingChar)
{return this._padHelper(totalWidth,paddingChar,false);}
String.prototype.padRight=function(totalWidth,paddingChar)
{return this._padHelper(totalWidth,paddingChar,true);}
if(!String.prototype.replace)
{String.prototype.replace=function(oldValue,newValue)
{if((oldValue==null)||(oldValue.length==0))
{return this.toString();}
if(newValue==null)
{newValue="";}
if(this.indexOf(oldValue)>-1)
{return this.split(oldValue).join(newValue);}
return this;}}
String.prototype.startsWith=function(value)
{if(value==null)
{return false;}
if(this.length<value.length)
{return false;}
if(this.charAt(0)!=value.charAt(0))
{return false;}
return(String.compare(this.substr(0,value.length),value)==0);}
String.prototype.toBoolean=function()
{if(this.length==0)
{return false;}
return true;}
String.prototype.toCharArray=function(startIndex,count)
{var arr;arr=[];if(this=="")
{return arr;}
if((startIndex<0)||(startIndex==null)||(startIndex>this.length)||(startIndex>this.length-count))
{startIndex=0;}
if((count<=0)||(count==null))
{startIndex=0;count=this.length;}
arr=this.split("");if((startIndex!=0)||(count!=this.length))
{arr=arr.splice(startIndex,count)}
return arr;}
String.prototype._trimHelper=function(trimChars,trimStart,trimEnd)
{if(trimStart==null)
{trimStart=false;}
if(trimEnd==null)
{trimEnd=false;}
var str,iLeft,iRight;str=this.copy();if(trimStart)
{for(iLeft=0;(iLeft<str.length)&&(trimChars.contains(str.charAt(iLeft)));iLeft++)
{}
str=str.substr(iLeft);}
if(trimEnd)
{for(iRight=str.length-1;(iRight>=0)&&(trimChars.contains(str.charAt(iRight)));iRight--)
{}
str=str.substring(0,iRight+1);}
return str;}
String.prototype.trim=function(trimChars)
{if((trimChars==null)||(trimChars.length==0))
{trimChars=String.whiteSpaceChars;}
return this._trimHelper(trimChars,true,true);}
String.prototype.trimEnd=function(trimChars)
{if((trimChars==null)||(trimChars.length==0))
{trimChars=String.whiteSpaceChars;}
return this._trimHelper(trimChars,null,true);}
String.prototype.trimStart=function(trimChars)
{if((trimChars==null)||(trimChars.length==0))
{trimChars=String.whiteSpaceChars;}
return this._trimHelper(trimChars,true);}
String.whiteSpaceChars=["\u0009","\u000A","\u000B","\u000C","\u000D","\u0020","\u00A0","\u2000","\u2001","\u2002","\u2003","\u2004","\u2005","\u2006","\u2007","\u2008","\u2009","\u200A","\u200B","\u3000","\uFEFF"];_global.hasOwnProperty=Object.prototype.hasOwnProperty;_global.propertyIsEnumerable=Object.prototype.propertyIsEnumerable;if(!_global.buRRRn.Reflection)
{_global.buRRRn.Reflection={};}
buRRRn.Reflection.memoize=false;buRRRn.Reflection.getTypeOf=function(o)
{if(o===undefined)
{return"undefined";}
if(o===null)
{return"null";}
switch(o.constructor)
{case Array:return"array";case Boolean:return"boolean";case Date:return"date";case Error:return"error";case Function:return"function";case Number:return"number";case String:return"string";case Object:return"object";default:return(typeof o);}}
buRRRn.Reflection.getCoreObjectPath=function(o)
{switch(o)
{case Array:return"Array";case Boolean:return"Boolean";case Date:return"Date";case Error:return"Error";case Function:return"Function";case Number:return"Number";case String:return"String";case Object:return"Object";}
return undefined;}
buRRRn.Reflection.getConstructorPath=function(o)
{if(o==_global)
{return"Object";}
var path=this.getObjectPath(o.constructor);if(path==undefined)
{path="Object";}
return path;}
buRRRn.Reflection.getConstructorName=function(o)
{var path=this.getConstructorPath(o);if(path.indexOf(".")>-1)
{path=path.split(".");return path.pop();}
return path;}
buRRRn.Reflection.getConstructorByName=function(name)
{var path;var original=name;if(name.indexOf(".")>-1)
{path=name.split(".");}
else
{path=[name];}
var root=path.shift();var ref=_global[root];if(ref==undefined)
{throw new Error("_global."+original+" does not exists");}
for(var i=0;i<path.length;i++)
{ref=ref[path[i]];if(ref==undefined)
{throw new Error("_global."+original+" does not exists");}}
if(typeof ref=="function")
{return ref;}
else
{throw new Error("_global."+original+" is not a function constructor");}}
buRRRn.Reflection.getConstructorMethods=function(o,inherited)
{if(inherited==null)
{inherited=false;}
var member;var members=[];for(member in o.prototype)
{if(typeof o.prototype[member]=="function")
{if(inherited||(o===Object))
{members.push(member);}
else if(o.prototype[member]!=Object.prototype[member])
{members.push(member);}}}
return members;}
buRRRn.Reflection.getObjectMethods=function(o)
{var member;var members=[];for(member in o)
{if(typeof o[member]=="function")
{if((o!==Object)&&(o[member]!==Object.prototype[member])&&(o[member]!==Object[member]))
{members.push(member);}
else if((o===Object)&&(o[member]!==Object.prototype[member])&&(o[member]!==Function.prototype[member]))
{members.push(member);}}}
return members;}
buRRRn.Reflection.getMethodByName=function(o,name)
{var methods=this.getConstructorMethods(o);var omethods=this.getObjectMethods(o);if(methods.indexOf(name)>-1)
{return o.prototype[name];}
if(omethods.indexOf(name)>-1)
{return o[name];}
return null;}
buRRRn.Reflection.hasConstructorByName=function(name)
{try
{var ctor=this.getConstructorByName(name);}
catch(e)
{return false;}
return true;}
buRRRn.Reflection.getObjectPath=function(target,scope)
{var maxRecursion,commands,values,refs,name,ref,scopePath,isCoreObject,m,mm;maxRecursion=200;commands=[];values=[];refs=[];scopePath="";if(target==null)
{return undefined;}
if(target===_global)
{return"_global";}
isCoreObject=this.getCoreObjectPath(target);if(isCoreObject!=undefined)
{return isCoreObject;}
if(scope==null)
{scope=_global;}
else
{scopePath=this.getCoreObjectPath(scope);if(scopePath==undefined)
{scopePath=this.getObjectPath(scope);}}
if(target.__path__)
{return target.__path__;}
var list=function()
{name=values.pop();ref=refs.pop();if(ref==null)
{values.push("");}
else
{for(m in ref)
{if(m=="prototype")
{continue;}
if((ref[m]!=null)&&(ref[m].constructor==Array))
{continue;}
if(((typeof(ref[m])=="object")||(typeof(ref[m])=="function"))&&(ref.hasOwnProperty(m)))
{commands.push(list);values.push(name+"."+m);refs.push(ref[m]);}}}}
for(mm in scope)
{if(buRRRn.core2.isGlobalReserved(mm))
{continue;}
commands.push(list);values.push(mm);refs.push(scope[mm]);}
if(scope==_global)
{var i,coreObjects,coreObject;coreObjects=["Array","Boolean","Date","Error","Function","Number","String","Object"]
for(i=0;i<coreObjects.length;i++)
{coreObject=coreObjects[i];commands.push(list);values.push(coreObject);refs.push(scope[coreObject]);}}
while((commands.length!=0)&&(commands.length<maxRecursion))
{commands.pop()();if(ref===target)
{if(this.memoize&&(scope==_global))
{target.__path__=name;}
return scopePath+name;}}
return undefined;}
buRRRn.Operators={};buRRRn.Operators.is=function(o)
{return function(type)
{if((typeof type=="string")||(type instanceof String))
{type=buRRRn.Reflection.getConstructorByName(type);}
if(o===undefined)
{if(type===undefined)
{return true;}
return false;}
if(o===null)
{if(type===null)
{return true;}
return false;}
if(o.constructor)
{return o.constructor==type;}
if(o instanceof type)
{return true;}
return false;}}
buRRRn.core2.after();